<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script th:src="@{/js/jquery-1.8.0.js}"></script>
    <link rel="stylesheet" th:href="@{/bootstrap-3.4.1-dist/css/bootstrap.min.css}">
    <script th:src="@{/bootstrap-3.4.1-dist/js/bootstrap.min.js}"></script>
</head>
<body>
<div style="margin-left: 1200px;">
    欢迎你[[${session.user.username}]]
</div>
<hr/>
<form class="form-inline" action="/QUserByName">
    <div class="form-group">
        <label for="QUsername">用户名</label>
        <input type="text" name="QUsername" class="form-control" id="QUsername" placeholder="用户名">
    </div>
    <button type="submit" class="btn btn-default">搜索</button>
</form>
<hr/>
<table class="table table-striped table-hover">
    <tr>
        <th>id</th>
        <th>username</th>
        <th>password</th>
        <th>createTime</th>
        <th>errorTime</th>
        <th>errorCount</th>
        <th></th>
    </tr>
    <tr th:each="user:${page.list}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.username}"></td>
        <td th:text="${user.password}"></td>
        <td th:text="${user.createtime}"></td>
        <td th:text="${user.errortime}"></td>
        <td th:text="${user.errorcount}"></td>
        <td>
            <a th:href="@{/user/delUser/{id}(id=${user.id},pn=${page.pageNum})}" type="button">删除</a>
        </td>
    </tr>
</table>
<div style="margin-left: 1200px;">
    <div >当前第&nbsp;[[${page.pageNum}]]&nbsp;页&nbsp; &nbsp;
        总计&nbsp;[[${page.pages}]] &nbsp;页&nbsp; &nbsp;
        共&nbsp;[[${page.total}]] &nbsp;条记录&nbsp; &nbsp;
    </div>

    <nav aria-label="Page navigation">
        <ul class="pagination">
            <li class="prev"><a th:href="@{/allUser(pn=(${page.pageNum}-1))}">← Previous</a></li>
            <li th:class="${num==page.pageNum?'active':''}" th:each="num:${page.navigatepageNums}">
                <a th:href="@{/allUser(pn=${num})}">[[${num}]]</a>
            </li>
            <li class="next"><a th:href="@{/allUser(pn=(${page.pageNum}+1))}">Next → </a></li>
        </ul>
    </nav>
</div>
</body>
</html>